package com.ch.playandroid.databinding

import android.util.Log
import android.widget.ImageView
import androidx.annotation.ColorInt
import androidx.databinding.BindingAdapter
import coil.load
import com.ch.playandroid.bean.Data
import com.google.android.material.appbar.CollapsingToolbarLayout

@BindingAdapter("android:tool_bar_layout_setExpandedTitleColor", requireAll = false)
fun setExpandedTitleColor(layout: CollapsingToolbarLayout, @ColorInt color: Int) {
    color?.run {
        layout.setExpandedTitleColor(this)
    }

}


@BindingAdapter("android:image_setImgae", requireAll = false)
fun setImageView(imageView: ImageView, data: Data) {
    Log.e("Hogan","----data---${data.imagePath}")
    imageView?.run {
        imageView.load(data?.imagePath)
    }

}